/* 通用样式，重置部分默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 内容顶部对齐 */
    align-items: flex-start; /* 内容左对齐 */
    min-height: 100vh;
    padding: 20px;
}

header {
    width: 100%;
    background-color: #e60000; /* 设置菜单栏背景为红色 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    position: relative;
    text-align: center;
}

.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white; /* 标题为白色 */
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

.navbar ul li {
    margin-right: 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: white; /* 菜单栏文字为白色 */
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #ffd1d1; /* 悬停为浅红 */
}

main {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    text-align: left; /* 内容左对齐 */
}

h1 {
    font-size: 24px;
    margin-top: 20px;
    color: #e60000; /* 设置标题颜色为红色 */
}

form {
    margin-bottom: 20px;
}

label {
    font-size: 16px;
    color: #666;
    margin-right: 10px;
}

select {
    padding: 5px;
    font-size: 16px;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
}

input[type="submit"] {
    padding: 5px 10px;
    background-color: #e60000;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: #cc0000;
}

.post-item {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    width: 100%; /* 填满可用宽度 */
}

.post-item h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.post-item p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    overflow: hidden; /* 确保内容不超出 */
}

.btn-edit, .btn-delete {
    padding: 5px 10px;
    text-decoration: none;
    color: white;
    background-color: #007bff;
    border-radius: 5px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.btn-edit:hover, .btn-delete:hover {
    background-color: #0056b3;
}

.btn-delete {
    background-color: #dc3545;
}

footer {
    text-align: center;
    padding: 10px 0;
    background-color: #e60000; /* 底部背景为红色 */
    color: white; /* 底部文字为白色 */
    position: relative;
    width: 100%;
    bottom: 0;
}
/* 按钮样式 */
.btn-container {
    margin: 20px 0;

}

/* 增加帖子按钮样式 */
.btn-add-post {
    display: inline-block;
    padding: 12px 24px; /* 增加内边距，让按钮更大 */
    font-size: 18px; /* 更大的字体，更容易点击 */
    color: #fff;
    background-color: #28a745; /* 使用绿色背景，给人一种积极的感觉 */
    text-decoration: none;
    border-radius: 50px; /* 圆形按钮边角 */
    transition: background-color 0.3s, transform 0.3s ease; /* 平滑的背景色和缩放效果 */
    font-weight: bold; /* 字体加粗 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
}

.btn-add-post:hover {
    background-color: #218838; /* 悬停时颜色变暗 */
    transform: scale(1.1); /* 悬停时按钮稍微放大 */
}

.btn-add-post:active {
    transform: scale(1); /* 按钮点击时恢复正常大小 */
}

.btn-add-post:focus {
    outline: none; /* 去掉焦点时的外框 */
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.3); /* 聚焦时添加绿色的外框 */
}
